<extend name="Public:base" />
<block name="main">
	<div class="content">
		<section class="location">
			<i class="iconfont">&#xe60f</i> 位置：<a href="{:U('Index/main')}">管理首页</a> &gt; <a href="{:U('index',array('category_id' => $categoryInfo[id]))}">{$categoryInfo.name}</a>
		</section>
		<ul class="nav-tabs clearfix">
			<li class="active">编辑单页</li>
		</ul>
		<form method="post" action="" id="form">
			<input type="hidden" name="id" id="id" value="{$viewInfo.id}" />
			<input type="hidden" name="category_id" id="category_id" value="{$viewInfo.category_id}" />
			<input type="hidden" name="model_id" id="model_id" value="1" />
			<input type="hidden" name="cid" id="cid" value="{$viewInfo.cid}" />
			<input type="hidden" name="class" id="class" value="{$Think.CONTROLLER_NAME}" />
			<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table">
			<tr>
				<th width="100">标题</th>
				<td><input type="text" name="title" id="title" class="form-control form-control-lg" value="{$viewInfo.title}" required /> <span class="red"> *</span> </td>
			</tr>
			<tr>
				<th>副标题</th>
				<td><input type="text" name="shorttitle" id="shorttitle" class="form-control form-control-lg" value="{$viewInfo.shorttitle}" /></td>
			</tr>
			<tr>
				<th>封面</th>
				<td>
					<img id="img1" <if condition="$viewInfo.thumb eq ''">src="__IMG__/noPhoto.png"<else />src="__ROOT__{$viewInfo.thumb}"</if> width="120" height="120" />
					<input type="file" name="btn_upload_thumb" id="btn_upload_thumb" />
					<input type="button" class="btn btn-gary cancel" onclick="thumbDel();" value="删除图片" />
					<input type="text" name="thumb" id="thumb" class="form-control" value="{$viewInfo.thumb}" />
				</td>
			</tr>
			<tr>
				<th>原文地址</th>
				<td><input type="text" name="url" id="url" class="form-control form-control-lg" value="{$viewInfo.url}" /></td>
			</tr>
			<tr>
				<th>关键词</th>
				<td><input type="text" name="keywords" id="keywords" class="form-control form-control-lg" value="{$viewInfo.keywords}" /> 多关键词之间用英文逗号","隔开</td>
			</tr>
			<tr>
				<th>摘要</th>
				<td><textarea name="description" id="description" class="form-control form-control-lg">{$viewInfo.description}</textarea></td>
			</tr>
			<tr>
				<th>内容</th>
				<td><script id="content" name="content" type="text/plain" style="width:100%;height:350px;">{$viewInfo.content|htmlspecialchars_decode}</script></td>
			</tr>
			<tr>
				<th>图片相册</th>
				<td>
    				<div class="img_box clearfix" id="img_box">
						<volist name="gallery" id="info">
						<div class="list-gallery">	
							<figure class="img_info"><img src="__ROOT__{$info.image_src}" alt="{$info.name}" class="img" /><figcaption class="title">{$info.name}</figcaption><figcaption class="desc">{$info.desc}</figcaption><figcaption>排序：<span class="sort">{$info.order_id}</span></figcaption></figure>
							<div class="img_ctrl">
								<span class="btn glyphicon-tag" title="修改名称"><i class="iconfont">&#xe607</i></span>
								<span class="btn glyphicon-desc" title="修改简介"><i class="iconfont">&#xe607</i></span>
								<span class="btn glyphicon-sort" title="修改排序"><i class="iconfont">&#xe606</i></span>
								<span class="btn glyphicon-trash" title="删除文件"><i class="iconfont">&#xe60d</i></span>
							</div>
							<div class="img_name">
								<input type="text" class="form-control savename" value="{$info.name}" />
								<button class="btn btn-primary save_name inline-block">保存</button>
							</div>
							<div class="img_desc">
								<textarea class="form-control form-control-md savedesc">{$info.desc}</textarea>
								<button class="btn btn-primary save_desc inline-block">保存</button>
							</div>
							<div class="img_sort">
								<input type="text" class="form-control savesort" value="{$info.order_id}" />
								<button class="btn btn-primary save_sort inline-block">保存</button>
							</div>
						</div>
						</volist>
					</div>
					<input type="file" name="btn_upload_gallery" id="btn_upload_gallery" multiple />
				</td>
			</tr>
			</table>
			<div class="well"><button type="submit" class="btn btn-theme" id="submit_save">保 存</button> <button class="btn btn-gary" onclick="javascript:history.back(-1);">返 回</button></div>
		</form>
	</div>
</block>
<block name="JS">
	<script>
		var ue = UE.getEditor('content');
	</script>
</block>